package com.zrt.view;

import org.springframework.stereotype.Controller;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@Controller
public class ModifyTeacher extends JDialog implements ActionListener {

    JLabel jl1, jl2, jl3, jl4, jl5, jl6, jl7,jl8;
    JTextField jtf1, jtf2, jtf3, jtf4, jtf5, jtf6, jtf7,jtf8;
    JButton jb1;
    JTable table;
    int i;

    public void myModifyTeacher(JTable table, int i){

        this.table = table;
        this.i = i;

        jl1 = new JLabel("工号");
        jl1.setBounds(20, 20, 100, 35);
        jl1.setFont(new Font("宋体", Font.BOLD, 25));
        add(jl1);

        jtf1 = new JTextField();
        jtf1.setText((String) table.getValueAt(i, 0).toString());
        jtf1.setEditable(false);
        jtf1.setBounds(100, 20, 120, 35);
        jtf1.setFont(new Font("宋体", Font.BOLD, 20));
        add(jtf1);

        jl2 = new JLabel("姓名");
        jl2.setBounds(20, 70, 100, 35);
        jl2.setFont(new Font("宋体", Font.BOLD, 25));
        add(jl2);

        jtf2 = new JTextField();
        jtf2.setText((String) table.getValueAt(i, 1));
        jtf2.setBounds(100, 70, 120, 35);
        jtf2.setFont(new Font("宋体", Font.BOLD, 20));
        add(jtf2);

        jl3 = new JLabel("性别");
        jl3.setBounds(20, 120, 100, 35);
        jl3.setFont(new Font("宋体", Font.BOLD, 25));
        add(jl3);

        jtf3 = new JTextField();
        jtf3.setText((String) table.getValueAt(i, 2));
        jtf3.setBounds(100, 120, 120, 35);
        jtf3.setFont(new Font("宋体", Font.BOLD, 20));
        add(jtf3);

        jl4 = new JLabel("年龄");
        jl4.setBounds(20, 170, 100, 35);
        jl4.setFont(new Font("宋体", Font.BOLD, 25));
        add(jl4);

        jtf4 = new JTextField();
        jtf4.setBounds(100, 170, 120, 35);
        jtf4.setText((String) table.getValueAt(i, 3).toString());
        jtf4.setFont(new Font("宋体", Font.BOLD, 20));
        add(jtf4);

        jl5 = new JLabel("职    位");
        jl5.setBounds(250, 20, 180, 35);
        jl5.setFont(new Font("宋体", Font.BOLD, 25));
        add(jl5);

        jtf5 = new JTextField();
        jtf5.setBounds(380, 20, 120, 35);
        jtf5.setText((String) table.getValueAt(i, 4));
        jtf5.setFont(new Font("宋体", Font.BOLD, 20));
        add(jtf5);

        jl6 = new JLabel("固定工资");
        jl6.setBounds(250, 70, 180, 35);
        jl6.setFont(new Font("宋体", Font.BOLD, 25));
        add(jl6);

        jtf6 = new JTextField();
        jtf6.setText((String) table.getValueAt(i, 5).toString());
        jtf6.setBounds(380, 70, 120, 35);
        jtf6.setFont(new Font("宋体", Font.BOLD, 20));
        add(jtf6);

        jl7 = new JLabel("课 时 费");
        jl7.setBounds(250, 120, 180, 35);
        jl7.setFont(new Font("宋体", Font.BOLD, 25));
        add(jl7);

        jtf7 = new JTextField();
        jtf7.setText((String) table.getValueAt(i, 6).toString());
        jtf7.setBounds(380, 120, 120, 35);
        jtf7.setFont(new Font("宋体", Font.BOLD, 20));
        add(jtf7);

        jl8 = new JLabel("工    资");
        jl8.setBounds(250, 170, 180, 35);
        jl8.setFont(new Font("宋体", Font.BOLD, 25));
        add(jl8);

        jtf8 = new JTextField();
        jtf8.setText((String) table.getValueAt(i, 7).toString());
        jtf8.setBounds(380, 170, 120, 35);
        jtf8.setFont(new Font("宋体", Font.BOLD, 20));
        add(jtf8);

        jb1 = new JButton("确认");
        jb1.setBounds(200, 250, 100, 35);
        jb1.setFont(new Font("宋体", Font.PLAIN, 25));
        add(jb1);

        setTitle("电子科技大学成都学院财务管理系统");
        setLayout(null);
        setSize(550, 350);
        setLocation(550, 250);
        setResizable(false);
        setModal(true);
        setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
        setVisible(true);
    }

    @Override
    public void actionPerformed(ActionEvent e) {

    }
}
